module CategoriesHelper

  def get_roots_categories_li(cats)
    ret = '<ul class="links">'
    for cat in cats
      ret << "<li>#{link_to(cat.label,category_medias_path(cat))}</li>"
    end
    return ret << '</ul>'
  end

  def get_categories_select(cats)
    ret = '<select name="categ">'
    cat_bordel_id = Category.get_bordel_cat_id
    for cat in cats
      if cat_bordel_id == cat.id
        ret << "<option value=\"#{cat.id}\" selected>#{cat.label}"
      else
        ret << "<option value=\"#{cat.id}\">#{cat.label}"
      end
    end
    return ret << '</select>'
  end

end
